Colin Walters [Tue, 14 Jun 2016 14:46:15 +0000 (10:46 -0400)]
libglnx porting: Use of GSDirFdIterator
This one was pretty simple. One of the uses in `repo.c` was just a
leftover variable.
Closes: #341
Approved by: jlebon
Colin Walters [Mon, 20 Jun 2016 22:13:58 +0000 (18:13 -0400)]
libostree.sym: Fix test-symbols
The test isn't smart enough to ignore comments, so change the prefix.
Closes: #356
Approved by: jlebon
Colin Walters [Mon, 20 Jun 2016 14:46:50 +0000 (10:46 -0400)]
Release 2016.6
Colin Walters [Fri, 17 Jun 2016 02:16:27 +0000 (22:16 -0400)]
pull: Ensure we always process queue only from main thread
I was easily reproducing a hang on pulls with thousands of requests on
current git master. The initial symptom seemed to be that there are
multiple code paths where we don't invoke
`session_thread_process_pending_queue()`. We really need to do
that any time we remove something from the outstanding queue,
to ensure it gets filled again.
A further issue is that we were tying the lifecycle of the pending
object to the `GTask`, but the task could be unref'd from the main
thread (via a `GSource` on the main thread), and that introduced
threadsafety issues, because the hash table and other data suddenly
could be concurrently modified.
Both of these need to be fixed together. First, we introduce
`Arc<Pending>`, and ensure that both the main and worker threads hold
references.
Second, we ensure that we re-process the queue *immediately* whenever
a task is done, inside the worker thread, rather than doing it
incidentally via an unref. This architecture is quite similar to what
the outside pull code is doing.
Closes: #350
Approved by: jlebon
Colin Walters [Fri, 17 Jun 2016 13:43:51 +0000 (09:43 -0400)]
tests: Support OT_SKIP_READDIR_RAND
For some reason I'm really not inclined to debug right now, `libtool`
is eating the `-fsanitize=address` argument when linking
`libreaddir-rand.so`, which causes failures since we're trying to
`LD_PRELOAD`.
Closes: #351
Approved by: jlebon
Colin Walters [Fri, 17 Jun 2016 13:36:51 +0000 (09:36 -0400)]
build: Fix libreaddir-rand to honor global CFLAGS
It's unfortunate that in automake one has to explicitly include the globa
`$(AM_CFLAGS)` if one sets `CFLAGS`, and similarly for other variables.
I'm trying to use `-fsanitize=address`, and not including it was
causing linker failures.
We also weren't inheriting the global warnings etc., so I had to fix a
decl-after-statement.
Closes: #351
Approved by: jlebon
Colin Walters [Thu, 16 Jun 2016 15:25:37 +0000 (11:25 -0400)]
manual: Discuss mirroring
This should likely be its own section, but it makes enough sense here
for now too.
Closes: #347
Approved by: yuqi-zhang
Colin Walters [Fri, 17 Jun 2016 01:51:13 +0000 (21:51 -0400)]
repo: Avoid a possible divide by zero in progress
The previous code was subject to a divide by zero if less than a
second had passed. Rework it so we only do the divide if more than a
second has passed.
Closes: #349
Approved by: Mathnerd314
Yu Qi Zhang [Thu, 16 Jun 2016 18:51:10 +0000 (18:51 +0000)]
libglnx porting: delete temp files on failure of file creation
We noticed the temp files being left over in ostree when (mistakenly)
trying to create refs with names in use by folders. This fix removes
temp files created by glnx_file_replace_contents_at on failure.
Closes: #348
Approved by: cgwalters
Colin Walters [Thu, 16 Jun 2016 14:07:26 +0000 (10:07 -0400)]
Add "archive" as an alias for "archive-z2"
I find the "-z2" is really a long ago relic of the past when I changed
the format. We no longer have anything to do with the original
`archive`, so let's start allowing people to type `--mode=archive`
which just looks saner.
At some point later I'll update the docs too, but it'll be an annoying
transition period as we'll have to say "On older OSTree, use -z2" etc.
Closes: #346
Approved by: giuseppe
Colin Walters [Wed, 15 Jun 2016 13:20:11 +0000 (09:20 -0400)]
manual: Link to mender.io
Came out of a discussion on the list.
Closes: #344
Approved by: jlebon
Yu Qi Zhang [Tue, 14 Jun 2016 14:13:06 +0000 (14:13 +0000)]
refs: add "ostree refs --create" and unit tests
Added the ability to create a ref (much like a git tag) for an
existing commit through "ostree refs EXISTING --create=NEWREF".
Previously the only way to create a new ref was by creating a new commit,
but refs --create allows multiple refs to point to the same commit.
The command will fail if:
- None/more than one existing ref is specified
- The specified EXISTING tag does not exist, or was not specified
- The specified NEWREF already exists, or is the name of a folder
Add unit tests in tests-ref.sh to verify above functionality
Closes: #340
Approved by: jlebon
Colin Walters [Thu, 9 Jun 2016 18:30:14 +0000 (14:30 -0400)]
lib: Port some manual close() cleanups to be glnx_fd_close
Just noticed this while reading some code, we didn't have many manual
`out: close()` bits left, this pushes us over the edge to autocleanup
almost everywhere.
Closes: #332
Approved by: jlebon
Simon McVittie [Sun, 12 Jun 2016 13:32:51 +0000 (09:32 -0400)]
build: re-create tests/ostree-symlink-stamp if Makefile changes
The filename of the real ostree executable could be either .libs/ostree
or .libs/lt-ostree.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 13:21:19 +0000 (09:21 -0400)]
libostreetest: include libtest.sh from srcdir, not builddir
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 09:51:11 +0000 (10:51 +0100)]
libtest: make gpghome in tmpdir writeable
Otherwise, during "make distcheck" it will be read-only (because it
is a copy of the read-only ${srcdir} with permissions preserved), and
deletion will fail during cleanup.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 09:45:48 +0000 (10:45 +0100)]
build: distribute more test files
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 09:43:34 +0000 (10:43 +0100)]
build: distribute TAP helper scripts in tarballs
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 09:39:46 +0000 (10:39 +0100)]
build: distribute test scripts in tarballs
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 09:36:44 +0000 (10:36 +0100)]
build: distribute libostree.sym in tarballs
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 09:31:29 +0000 (10:31 +0100)]
autogen.sh: rely on VPATH for submodules' Makefile-*.am.inc
This avoids hard-coding the autogen-time ${srcdir} into our build
system, and might fix "make distcheck".
We don't need to specify ${srcdir} explicitly in the various variables,
because Automake always uses make's VPATH feature to look in both
${builddir} and ${srcdir} at build time.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #337
Approved by: cgwalters
Simon McVittie [Sun, 12 Jun 2016 14:25:21 +0000 (10:25 -0400)]
Link libreaddir-rand to libdl
It uses dlsym(). There's no point in being extra-portable here
because OSTree only targets Linux anyway.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #336
Approved by: cgwalters
Simon McVittie [Sat, 11 Jun 2016 18:07:40 +0000 (19:07 +0100)]
test-sysroot.js: set "strict mode" when sourcing libtest.sh
As with the C tests in commit
08580118, this makes sure the test
fails as soon as something goes wrong.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #335
Approved by: giuseppe
Alexander Larsson [Fri, 10 Jun 2016 11:28:08 +0000 (13:28 +0200)]
tests: Exit valgrind tests if a leak is detected
This fails the test if OT_TESTS_VALGRIND is set and valgrind
detects a leak.
Closes: #334
Approved by: cgwalters
Alexander Larsson [Fri, 10 Jun 2016 10:13:23 +0000 (12:13 +0200)]
pull: Fix leak of refs_to_fetch
Closes: #333
Approved by: giuseppe
Alexander Larsson [Fri, 10 Jun 2016 10:12:58 +0000 (12:12 +0200)]
pull: Fix leaked uri in request_static_delta_superblock_sync
Closes: #333
Approved by: giuseppe
Alexander Larsson [Fri, 10 Jun 2016 10:12:33 +0000 (12:12 +0200)]
pull: Fix leak of FetchObjectData in some cases
Closes: #333
Approved by: giuseppe
Alexander Larsson [Fri, 10 Jun 2016 10:12:07 +0000 (12:12 +0200)]
pull: Fix leak of debug temporary strings
Closes: #333
Approved by: giuseppe
Alexander Larsson [Fri, 10 Jun 2016 10:10:37 +0000 (12:10 +0200)]
libotutil: Fix leak of VariantMapData
Closes: #333
Approved by: giuseppe
Colin Walters [Wed, 11 May 2016 19:54:48 +0000 (15:54 -0400)]
tests: Modernize valgrind infrastructure
The recent memleak fixes motivated me to look at the bitrotted code to
run invocations of `ostree` in the test suite underneath valgrind.
There are a few things here. First, update suppressions file from
libhif, since I recently worked on it.
When running *uninstalled* as we now support, we need
`libtool --mode=execute` in the mix so it expands out to
the uninstalled binary and we don't valgrind the intermediate shell.
However, it's harder than that because we chdir into a tmpdir,
which defeats the libtool logic. AFAICS, the only fix for this
is to determine the realbin path before we chdir, and then unfortunately
we need to change every use of `ostree` to `${OSTREE}` =(
Then this immediately breaks for me on RHEL7 because my ancient
copy of `valgrind-3.10.0-16.el7.x86_64` is unaware of syscall 306, i.e.
`syncfs`.
But let's do this first before I dive into that.
Closes: #292
Approved by: krnowak
Colin Walters [Thu, 9 Jun 2016 14:49:03 +0000 (10:49 -0400)]
lib: Add OSTREE_SUPPRESS_SYNCFS environment variable
Just to work around valgrind not understanding the `syncfs()` syscall
in EL7 right now.
Closes: #292
Approved by: krnowak
Colin Walters [Wed, 11 May 2016 17:32:40 +0000 (13:32 -0400)]
lib: Fix a leak in remote parsing
As the docs say, `g_regex_match()` still allocates a match even if it
returns `FALSE`. Using `g_autoptr` is just plain better.
Closes: #292
Approved by: krnowak
Mathnerd314 [Fri, 3 Jun 2016 20:14:49 +0000 (14:14 -0600)]
related-projects: Update with more information and projects
In particular, NixOS has changed somewhat, and Conda is worth
looking at. Also it seems reasonable to mention rpm-ostree /
Gnome Continuous.
Closes: #331
Approved by: cgwalters
Mathnerd314 [Sat, 4 Jun 2016 22:16:05 +0000 (16:16 -0600)]
docs: Get API docs working again
This changes around a few things that didn't work for me:
* Section names seem to be ostree-* instead of libostree-*
* Also XML files are ostree-* (they didn't show up at all)
- gtk-doc doesn't seem to parse const _OSTREE_PUBLIC correctly
* pull documentation is now on the actual functions rather than stubs
* Update gitignore with some more files
And there some changes to make gtk-doc give fewer warnings (not finished)
Closes: #327
Approved by: cgwalters
Mathnerd314 [Wed, 1 Jun 2016 23:47:08 +0000 (17:47 -0600)]
pull: Move pull and pull_onedir back into ostree-repo.c
They call pull_with_options, which will fail anyway.
Closes: #327
Approved by: cgwalters
Mathnerd314 [Wed, 8 Jun 2016 18:48:44 +0000 (12:48 -0600)]
pull: Move libsoup-related code from ostree-repo.c to ostree-repo-pull.c
This centralizes the ifdef's in one file, which will make it
easier to write new pull backends.
ostree-repo-pull.c is now built unconditionally
Closes: #327
Approved by: cgwalters
Mathnerd314 [Wed, 8 Jun 2016 21:39:06 +0000 (15:39 -0600)]
repo: use OSTREE_TIMESTAMP (=1) for checked-out files
1 is a better choice than 0 because some programs use 0
as a special value; for example, GNU Tar warns of an
"implausibly old timestamp" with 0.
Closes: #330
Approved by: cgwalters
Colin Walters [Fri, 3 Jun 2016 15:04:17 +0000 (11:04 -0400)]
repo: (minor) Drop a GFile usage in signature creation
Just one user of hundreds but, the rest of the function was ported
now.
Closes: #319
Approved by: jlebon
Colin Walters [Fri, 3 Jun 2016 15:00:10 +0000 (11:00 -0400)]
lib: Add a helper for mmap->bytes with openat(), use it in repo
This kills another GSystem consumer...I think down the line I'd like
to do something like "detect whether file is > 1k if so, mmap,
otherwise just readall()" so we can use this helper in more places.
Closes: #319
Approved by: jlebon
Colin Walters [Fri, 3 Jun 2016 14:40:56 +0000 (10:40 -0400)]
lib: Add `_ALLOW_NOENT` flag to internal variant mapping API
We have a lot of "allow_noent" type wrapper functions since
a common pattern is to allow files to not exist, but still
throw cleanly on other issues.
This is another instance of that, and cleans up duplicated error
handling code.
Part of this is prep for moving away from `GFile` consumers.
Closes: #319
Approved by: jlebon
Colin Walters [Fri, 3 Jun 2016 14:22:05 +0000 (10:22 -0400)]
glnx porting: Drop use of gs_file_openat_noatime
As noted previously the "noatime" thing is mostly obsoleted by
relatime.
Closes: #319
Approved by: jlebon
Colin Walters [Fri, 3 Jun 2016 14:16:25 +0000 (10:16 -0400)]
libglnx porting: Drop last use of gs_transfer_out_value()
Closes: #319
Approved by: jlebon
Colin Walters [Fri, 3 Jun 2016 14:18:57 +0000 (10:18 -0400)]
glnx porting: Drop last uses of gs_file_get_basename_cached()
I apparently missed a few uses in the previous porting.
Closes: #319
Approved by: jlebon
Krzesimir Nowak [Thu, 9 Jun 2016 10:42:28 +0000 (12:42 +0200)]
repo: Fix build on 32-bit systems
On 32-bit systems the modifier for printing 64bit values should be
%llu instead of %lu. Just use appriopriate macros that do the right
thing.
Closes: #329
Approved by: giuseppe
Jonathan Lebon [Tue, 7 Jun 2016 19:08:16 +0000 (15:08 -0400)]
configure.ac: properly check for bison
The AC_PROG_YACC already does the checking for us, so we don't need to
use AC_CHECK_PROGS (which wasn't working anyway because autoconf didn't
run the check thinking it was cached already from the earlier
AC_PROC_YACC, so we didn't get the default ":" value)
Closes: #325
Approved by: cgwalters
Jonathan Lebon [Tue, 7 Jun 2016 18:44:55 +0000 (14:44 -0400)]
ostree_repo_write_commit: add missing docstring arg
Closes: #325
Approved by: cgwalters
Colin Walters [Mon, 6 Jun 2016 18:49:11 +0000 (14:49 -0400)]
tests/test-pull-c: New test that runs through the pull API via C
We have had in the past issues with running `ostree_repo_pull()`
multiple times in the same process, embarassingly enough. Nothing in
the current test suite covers this, so let's start.
Closes: #322
Approved by: jlebon
Colin Walters [Mon, 6 Jun 2016 19:00:13 +0000 (15:00 -0400)]
tests: Use strict mode by default for C tests
I was extending the C-based test suite to cover more, and noticed that
we weren't aborting if a command failed. That made the tests somewhat
less useful, so let's fix it.
Closes: #321
Approved by: jlebon
Krzesimir Nowak [Fri, 3 Jun 2016 19:35:52 +0000 (21:35 +0200)]
summary: Fix a typo
The --gpg-sign parameter will be used for signing the summary, not the
commit. This probably was copy-pasted from the ostree commit command.
Closes: #320
Approved by: cgwalters
Colin Walters [Tue, 31 May 2016 15:35:35 +0000 (11:35 -0400)]
glnx porting: Port away from gs_file_get_basename_cached()
In some cases we use glnx_basename(), in others we already had a
`GFileInfo` around with the name.
Closes: #316
Approved by: jlebon
Colin Walters [Tue, 31 May 2016 15:27:19 +0000 (11:27 -0400)]
libglnx porting: Port away from gs_file_map_noatime()
The "no atime" thing was mostly useful only before "relative atime"
updates landed. Users who care about performance will turn it off
entirely anyways.
Closes: #316
Approved by: jlebon
Colin Walters [Tue, 31 May 2016 15:53:27 +0000 (11:53 -0400)]
lib: Drop GFile variant mapping API for fd-relative
In addition to generic fd relative porting,
this is a necessary preparatory step for libglnx porting, because
when I tried to use `g_mapped_file_new` I hit an issue with
it using a different error domain from GIO.
Thankfully libglnx consistently uses the GIO error domain, and here
we're now using it for the `open()` call.
Closes: #317
Approved by: jlebon
Colin Walters [Wed, 1 Jun 2016 13:35:47 +0000 (09:35 -0400)]
lib: Change ot_util_variant_map helpers to consistently sink refs
This is similar to changes Krzesimir has been doing recently - we
really don't need the ergonomics of floating refs since we have
autocleanups.
We should continue to change most of our code to sink refs.
Specifically here it was pretty broken that the `_map()` API was
sinking but the other two weren't, and this broke some refactoring I
was trying to do later.
Closes: #317
Approved by: jlebon
Sam Spilsbury [Wed, 1 Jun 2016 08:15:00 +0000 (08:15 +0000)]
repo: Display estimated time remaining when pulling
Bug 765429 said that not having a time estimate can be annoying
when working with large pulls.
There isn't any complex time estimation logic here - we just take
the number of bytes remaining and do a linear projection of
the bytes per second rate at the current point in time.
Closes: #318
Approved by: cgwalters
Colin Walters [Sun, 29 May 2016 17:06:36 +0000 (13:06 -0400)]
core: Port to new libglnx tempname API
Drops another libgsystem use, and as bonus we malloc less too.
Closes: #311
Approved by: jlebon
Colin Walters [Mon, 30 May 2016 15:20:18 +0000 (11:20 -0400)]
sysroot: Correct error handling path in previous libglnx port
I happened to have the github page open with my commit after it was
merged, and then noticed a bug.
We still need to throw if we hit a non-`ENOENT` error.
Closes: #315
Approved by: giuseppe
Colin Walters [Sun, 29 May 2016 17:50:34 +0000 (13:50 -0400)]
libglnx porting: Port away from gs_file_ensure_directory()
The init-fs code in particular gets (IMO) a lot cleaner being fd
relative.
Closes: #312
Approved by: giuseppe
Colin Walters [Sun, 29 May 2016 17:33:25 +0000 (13:33 -0400)]
libglnx porting: Port callers of gs_file_unlink to just unlink()
In the second case it's actually less code too.
Closes: #312
Approved by: giuseppe
Colin Walters [Sun, 29 May 2016 17:29:18 +0000 (13:29 -0400)]
repo: Port uncompressed cache GC to libglnx
- Kills a user of `gs_file_unlink`
- Is fd-relative
- Is way less malloc-y.
Closes: #312
Approved by: giuseppe
Colin Walters [Sun, 29 May 2016 17:23:04 +0000 (13:23 -0400)]
libglnx porting: Port "load utf8 file" contents API callers
Closes: #312
Approved by: giuseppe
Krzesimir Nowak [Thu, 26 May 2016 09:54:28 +0000 (11:54 +0200)]
repo: Add functions for verifying any data in repository
This can be useful for validating the 3rd party data that is put in
the extensions directory and is signed with the same keys as commits
or the summary file.
Closes: #310
Approved by: cgwalters
Krzesimir Nowak [Thu, 26 May 2016 09:53:11 +0000 (11:53 +0200)]
repo: Factor out setting up a GPG verifier
Moved out setting up a GPG verifier to a separate function, as I would
like to use it for the any data verification function in the following
commit.
Closes: #310
Approved by: cgwalters
Krzesimir Nowak [Thu, 26 May 2016 09:51:13 +0000 (11:51 +0200)]
repo: Add a missing Returns paragraph
Closes: #310
Approved by: cgwalters
Krzesimir Nowak [Thu, 26 May 2016 09:48:21 +0000 (11:48 +0200)]
repo: Factor out the check of gpg result to a separate function
I plan to add a function for verifying any data which may return the
error about lack of trusted signatures, so let's avoid the redundancy
and put the check in the separate function.
Closes: #310
Approved by: cgwalters
Krzesimir Nowak [Mon, 23 May 2016 11:28:04 +0000 (13:28 +0200)]
core: Add a function creating an archive-z2 content stream
It is quite similar to the already existing
ostree_raw_file_to_content_stream function, so I factored the common
part to a separate function. The difference is that we cannot report
the size of the resulting stream.
Can be useful for serving a "bare" repository as a faked "archive-z2"
repository.
Closes: #308
Approved by: cgwalters
Mathnerd314 [Mon, 23 May 2016 19:32:36 +0000 (13:32 -0600)]
commit: Update manpage to reflect --editor
Closes: #305
Approved by: cgwalters
Mathnerd314 [Mon, 23 May 2016 18:52:56 +0000 (12:52 -0600)]
log: Display "(no subject)" for commits without a subject
This resolves the ambiguity for a message with a body but no subject,
and also hints that OSTree is using two bytes to store the empty
commit subject/body (when instead they could be stored, or rather,
not stored, as part of the metadata)
Closes: #305
Approved by: cgwalters
Mathnerd314 [Mon, 23 May 2016 18:49:37 +0000 (12:49 -0600)]
commit: Don't require a subject
In practice, a lot of subjects are empty, because the commit date
and branch are sufficient identification. For example, rpm-ostree
does not use subjects. It also doesn't use the command-line ostree
commit tool, so this was not a problem there, but this makes the
behavior consistent.
Also adds a test that empty subjects and omitting the subject
are equivalent. The --timestamp is so that the commits do not
have different timestamps.
Closes: #305
Approved by: cgwalters
Mathnerd314 [Mon, 23 May 2016 18:47:22 +0000 (12:47 -0600)]
commit: Display subject/body in commit editor
This allows automation to prefill the subject/body for the editor.
It could also be useful if some kind of "amend commit" functionality
was implemented.
Closes: #305
Approved by: cgwalters
Mathnerd314 [Mon, 23 May 2016 18:44:36 +0000 (12:44 -0600)]
commit: Add --editor / -e command line argument
Previously, the behavior was to run the editor if no subject or body was specified.
This led to using commit -s '' in scripts, to avoid running the editor.
In practice, manually editing commit messages is rare, whereas automated scripting
is common, so instead default to not running the editor and only run it when -e
is given.
Closes: #305
Approved by: cgwalters
Mathnerd314 [Mon, 23 May 2016 18:42:17 +0000 (12:42 -0600)]
commit: accept NULL subject argument
When given a NULL subject, use "" instead, like for the body argument
Closes: #305
Approved by: cgwalters
Alexander Larsson [Wed, 25 May 2016 09:00:19 +0000 (11:00 +0200)]
Build on older versions of glib
Various places need to include libglnx.h for the autoptr backport
fallbacks to be there before ostree-autocleanups.h is included.
This fixes the build on centos7ยท
Closes: #309
Approved by: giuseppe
Krzesimir Nowak [Tue, 24 May 2016 08:36:38 +0000 (10:36 +0200)]
libotutil: Plug a leak
There's no need to allocate the variant builder on a heap, so allocate
it on the stack and avoid a memory leak at the same time.
Closes: #307
Approved by: cgwalters
Giuseppe Scrivano [Mon, 23 May 2016 06:53:34 +0000 (08:53 +0200)]
man: add missing options for commit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #306
Approved by: cgwalters
Alexander Larsson [Fri, 20 May 2016 08:59:59 +0000 (10:59 +0200)]
tests: Fix build with old glib
test-checksum.c was using g_autofree without including libglnx.h which
has the backport for that.
Closes: #304
Approved by: cgwalters
Krzesimir Nowak [Thu, 19 May 2016 12:28:25 +0000 (14:28 +0200)]
build: Install new autocleanups header
Haven't noticed before that there is a separate variable for a list of
OSTree public headers. This fixes an embarrassing error that prohibits
building a project that includes ostree.h.
Closes: #302
Approved by: cgwalters
Krzesimir Nowak [Fri, 13 May 2016 06:08:49 +0000 (08:08 +0200)]
build: Allow ostree to use g_autoptr on its types internally
As an example, I g_autoptred one OstreeRepo in the "ostree init"
command.
Closes: #295
Approved by: cgwalters
Krzesimir Nowak [Fri, 13 May 2016 05:59:10 +0000 (07:59 +0200)]
build: Remind about bumping related versions
Closes: #295
Approved by: cgwalters
Krzesimir Nowak [Thu, 12 May 2016 12:42:26 +0000 (14:42 +0200)]
libostree: Add g_autoptr() support for the public types
To avoid breaking the ostree users we hide the autoptr setup behind an
OSTREE_WITH_AUTOCLEANUPS variable. The variable is set to 0 by
default, so users that want to start using them, have to define the
variable themselves to 1.
Probably after some transition period, the variable will be set 1 by
default.
This is conditional on GLib >= 2.44.0 being available. It does not
bump ostree's dependency on GLib.
Closes: #295
Approved by: cgwalters
Gatis Paeglis [Thu, 12 May 2016 12:42:38 +0000 (14:42 +0200)]
Fix build when have_libsoup_client_certs=no
This fixes a build failure with older libsoup versions
that do not have the client certificates feature.
Closes: #294
Approved by: cgwalters
Colin Walters [Fri, 13 May 2016 13:59:26 +0000 (09:59 -0400)]
README: x/xdg-app/flatpak/
I'm mostly just testing some Homu updates.
Closes: #299
Approved by: cgwalters
Krzesimir Nowak [Fri, 13 May 2016 11:34:57 +0000 (13:34 +0200)]
libostree: Fix bracket-missing warnings
Apparently I got the bracketing wrong in
862e6ecdcc58f025696b1394adfc0fcf7322df23:
src/libostree/ostree-repo.c: In function 'ostree_repo_delete_object':
src/libostree/ostree-repo.c:3538:11: warning: missing braces around
initializer [-Wmissing-braces]
g_auto(GVariantBuilder) builder = {0,};
Closes: #298
Approved by: cgwalters
Micah Abbott [Thu, 12 May 2016 20:54:06 +0000 (16:54 -0400)]
docs: fix swapped link syntax
A few links in the docs had the Markdown syntax swapped like:
(link title)[link url]
Just cleaned up those. Verified via `mkdocs serve`
Closes: #297
Approved by: cgwalters
Colin Walters [Thu, 12 May 2016 14:15:24 +0000 (10:15 -0400)]
build: Don't run glib-mkenums if there's nothing to do
This fixes the build without libsoup.
Closes: #296
Approved by: gatispaeglis
Colin Walters [Thu, 12 May 2016 14:32:17 +0000 (10:32 -0400)]
Make enum generation private by default, export stub symbol
When we added enum type generation, the generated symbols used
the `ostree_` prefix, and at the time that implied they were public.
So we started (if built with libsoup) exporting
`ostree_fetcher_config_flags_get_type`.
I think it's not worth confusing ABI checkers, so let's export the
dummy symbol forever, and switch enums to be private by default.
We should revisit this and also export some auto-generated enum
types for public enums, but that's a separate patch.
Closes: #296
Approved by: gatispaeglis
Sam Spilsbury [Tue, 21 Jul 2015 00:16:14 +0000 (08:16 +0800)]
Makefile: Move to AM_DISTCHECK_CONFIGURE_FLAGS
Since automake 1.11.2 it is recommended that packages
use AM_DISTCHECK_CONFIGURE_FLAGS instead of
DISTCHECK_CONFIGURE_FLAGS as the latter is intended
to be a user variable.
https://bugzilla.gnome.org/show_bug.cgi?id=766298
Closes: #293
Approved by: cgwalters
Krzesimir Nowak [Wed, 11 May 2016 09:04:04 +0000 (11:04 +0200)]
libostree: Variant-related leak plugs and fixes
This tries to avoid leaking GVariantBuilders and GVariants in some
situations. The leaks were usually happening when some error occurred
or because of unclear variant ownership situation.
The former is mostly about making sure that g_variant_builder_clear is
called on builders that didn't finish their variant building process.
The latter is surely more work - sometimes the result of
g_variant_builder_end() should not be passed directly to a function,
but rather stored in a g_autoptr(GVariant), sunk and then passed to a
function. IMO, with an advent of g_autoptr, GVariants should be always
sunk instead of relying on some receiver function sinking it. This
would make an easy-to-follow policy of always sinking your
variants. Functions could then assume that the passed variant is
already sunk. These leaks are still happenning in commands, but they
are less harmful, since that code will not be used by some daemon as a
library routine.
Closes: #291
Approved by: cgwalters
Krzesimir Nowak [Tue, 10 May 2016 10:45:49 +0000 (12:45 +0200)]
repo: Allow using options for fetching summary
This adds a _with_options variant of the
ostree_repo_remote_fetch_summary function, so we can tell the fetcher
to use a specific URL instead taking it from the remote config.
Closes: #290
Approved by: cgwalters
Krzesimir Nowak [Tue, 10 May 2016 10:23:03 +0000 (12:23 +0200)]
repo: Plug a leak
The base URI created in this line was always (sans erroneous
situations) overwritten in the code block below without freeing it
previously, so it leaked.
Closes: #290
Approved by: cgwalters
Krzesimir Nowak [Tue, 10 May 2016 09:59:12 +0000 (11:59 +0200)]
core: Improve variant format docs
Use markdown to actually format the tuple member descriptions as a
list. Currently they are hardly legible as gtk-doc formats them into a
single sentence.
Also update the additional metadata docs in the summary objects.
Closes: #289
Approved by: cgwalters
Jonathan Lebon [Wed, 13 Apr 2016 20:44:21 +0000 (16:44 -0400)]
OstreeRepo: add extensions directory
It's very useful for third-party applications to have someplace to store
their data guaranteed to be on the same device as the repo (thus
ensuring hardlinks) while still being shielded away from any of OSTree's
timely garbage collections.
We create a new "extensions/" subdirectory where apps can include
whatever they wish in "extensions/myapp/". This subdirectory is
completely unmanaged by ostree.
NB: I didn't bother making it a member of the OstreeRepo proper since we
don't really use it for anything else yet.
Closes: #286
Approved by: cgwalters
Krzesimir Nowak [Mon, 9 May 2016 13:11:18 +0000 (15:11 +0200)]
sysroot: Plug some leaks
The deployments and booted deployment were never unreffed.
Also, remote (void) from the call to the unload function - it returns
nothing, so there is no need to fool the compiler.
Closes: #287
Approved by: cgwalters
Colin Walters [Sat, 7 May 2016 15:22:47 +0000 (11:22 -0400)]
trivial-httpd: Add __attribute__((format))
I was briefly looking at building with clang mostly since it
detects unused variables with cleanup attributes, but then
I hit this fatal error.
It's a hard compile error with `-Wformat-nonliteral` since clang
doesn't know it's a format string.
Colin Walters [Fri, 6 May 2016 16:25:27 +0000 (12:25 -0400)]
build: Use --std=gnu99
It's actually very nice to be able to declare loop variables inside
the initializer.
Ideally we could turn off nested functions though.
Closes: #284
Approved by: jlebon
Jonathan Lebon [Fri, 22 Apr 2016 16:42:05 +0000 (12:42 -0400)]
tests/test-libarchive-import.c: add tests
- Do a bit of refactoring
- Add test for use_ostree_convention
- Add test for xattr_callback
- Add test for SELinux labeling
Closes: #275
Approved by: cgwalters
Jonathan Lebon [Fri, 22 Apr 2016 16:39:54 +0000 (12:39 -0400)]
tests/test-libarchive.sh: add more test
- Test both tar and cpio archives
- Test more hardlink corner cases
- Test symlinks more rigorously
- Test stat override
- Test skip list
Closes: #275
Approved by: cgwalters
Jonathan Lebon [Fri, 22 Apr 2016 16:35:48 +0000 (12:35 -0400)]
ot-builtin-commit.c: add --skip-list option
This was already supported by the commit modifier API, just needed to
expose it. This will also be used to test the libarchive API in a future
test.
Closes: #275
Approved by: cgwalters
Jonathan Lebon [Fri, 22 Apr 2016 16:24:04 +0000 (12:24 -0400)]
ostree-repo-libarchive.c: major refactor
- Make hardlink handling more generic. The previous strategy worked for
tar archives, but not for cpio. It now works for both.
- Add support for SEL labeling (through the OstreeRepoCommitModifier)
- Add support for xattr_callback (through the OstreeRepoCommitModifier)
- Add support for filter (through the OstreeRepoCommitModifier)
- Add a use_ostree_convention option
Closes: #275
Approved by: cgwalters
Colin Walters [Tue, 3 May 2016 21:24:25 +0000 (17:24 -0400)]
libglnx porting: Migrate to glnx_stream_fstat()
I ended up deciding to move this one into libglnx, seems like
something other libglnx-using software might want to do, even though
xdg-app doesn't right now.
Closes: #282
Approved by: jlebon
Colin Walters [Thu, 5 May 2016 21:20:04 +0000 (17:20 -0400)]
lib: Add more filename validations (no ., .. or /) in commit logic
The filesystem commit code will never give us potentially hostile
filenames, and when importing from archives, we do some validation.
However, we should be extra paranoid and also add error messages in
the mtree in case someone tries to import a hostile
libarchive-supported format.
Closes: #283
Approved by: jlebon